
public class Test {
    public static void main(String[] args) {
        int a = 10;
        long b = 100;
        //a = a + b;//会报错
        a += b;//运算符会帮我们进行类型转换
        System.out.println(a);
    }

    public static void main1(String[] args) {

        System.out.println("hello");

        int a = 1;
        System.out.println(a);
        //长整型  8个字节
        long b = 10;
        System.out.println(b);
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);
        System.out.println("================");

        short sh = 10;//短整型  2个字节
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);
        System.out.println("================");

        byte b1 = 10;//字节型  1个字节
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
        System.out.println("================");

        //System.out.println(10 / 0);
    }
}
